package org.feidao.chapter63.controller;

import com.alibaba.fastjson.JSONObject;
import org.feidao.chapter63.service.ConsumerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * Created by linghufeixia on 2022-11-5.
 */
@RestController
@RequestMapping(value = "/kafka")
public class KafkaController {

    @Autowired
    private ConsumerService consumerService;

    @RequestMapping(value = "/sendMessage", method = RequestMethod.GET)
    public String sendMessage(@RequestParam(value = "msg") String msg) {
        JSONObject jsonObject = new JSONObject();
        jsonObject.put("data", msg);
        return  jsonObject.toJSONString();
    }
}
